how to open an external file in python

34

how to open an external file in python -

import subprocess    

path_to_notepad = 'C:\\Windows\\System32\\notepad.exe'
path_to_file = 'C:\\Users\\Desktop\\hello.txt'

subprocess.call([path_to_notepad, path_to_file])

Comments

Submit
0 Comments